{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "7e7813b0",
   "metadata": {},
   "source": [
    "-------\n",
    "* 学习人：罗海鑫\n",
    "* 时间：2021-11-15\n",
    "* week12\n",
    "* 学习线上资源：[python官方文档](https://www.python.org)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f4c2c9e0",
   "metadata": {},
   "source": [
    "## 本周知识\n",
    "\n",
    "### 1.字典的一般方法\n",
    "\n",
    "> 1.字典的查询 查询key -> value\n",
    ">> 1. 先看字典的 key 是否存在 ： in 查询成员是否存在的重要方法\n",
    ">> 2. 查询\n",
    "> 2.字典的修改\n",
    "> 3.字典的删除\n",
    "> 4.字典的增加（dict_name[key] = value）\n",
    "\n",
    "### 2.字典的进阶方法\n",
    "> 1.字典的初始化\n",
    ">> 1. D.formkeys()\n",
    ">> 2. D.setdefault()\n",
    "\n",
    "### 3.字典的实践（一）课本\n",
    "\n",
    "### 4.字典的实践（二）课本\n",
    "\n",
    "### 5.字典的实践（三）课本\n",
    "\n",
    "#### 字典是在索引页找到对应页码（hash算法）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "98d97450",
   "metadata": {},
   "source": [
    "### 1.字典的一般方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "ff5da9f3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'stu1801': 'ZiQi', 'stu1802': 'XiaoFeng', 'stu1803': 'LiHua'}\n"
     ]
    }
   ],
   "source": [
    "stu_info = {\n",
    "    \"stu1801\":\"ZiQi\",\n",
    "    \"stu1802\":\"XiaoFeng\",\n",
    "    \"stu1803\":\"LiHua\"\n",
    "}\n",
    "print(stu_info)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5e476e5d",
   "metadata": {},
   "source": [
    "> 1. 字典的查询\n",
    ">> 1. 直接查找 dict_name[key] 当关键词key不存在时：报错KryError：‘stu1804’\n",
    ">> 2. get（）方法 D.get(k[.d]) 当关键词key不存在时：返回**zone**不存在。**不会报错**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "9ff47053",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'ZiQi'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 直接查找 dict_name[key]\n",
    "stu_info[\"stu1801\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "d0c9db9c",
   "metadata": {},
   "outputs": [
    {
     "ename": "KeyError",
     "evalue": "'stu1804'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mKeyError\u001b[0m                                  Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-3-af87bde9363c>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mstu_info\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"stu1804\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mKeyError\u001b[0m: 'stu1804'"
     ]
    }
   ],
   "source": [
    "stu_info[\"stu1804\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "ecfea110",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function get:\n",
      "\n",
      "get(key, default=None, /) method of builtins.dict instance\n",
      "    Return the value for key if key is in the dictionary, else default.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# 使用get方法\n",
    "help(stu_info.get)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "48d18e32",
   "metadata": {},
   "outputs": [],
   "source": [
    "stu_info.get(\"1801\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "377dd097",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "None\n"
     ]
    }
   ],
   "source": [
    "print(stu_info.get(\"1804\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "46262c8c",
   "metadata": {},
   "source": [
    "> 2. 修改 & 新增\n",
    ">> 1. 先查询 查看key是否存在，使用 in查询成员\n",
    ">> 2. 如果key存在 修改：dict_name[key] = value\n",
    ">> 3. 如果key不存在 新增：dict_name[key] = value\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "0565649b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查询 stu1804\n",
    "\"stu1804\" in stu_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "7a0aa5e7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查询 stu1803\n",
    "\"stu1803\" in stu_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "443eb635",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'stu1801': 'ZiQi', 'stu1802': 'XiaoFeng', 'stu1803': 'LiuYu'}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 如果key存在 修改\n",
    "if \"stu1803\" in stu_info:\n",
    "    stu_info[\"stu1803\"] = \"LiuYu\"\n",
    "stu_info"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2caf3650",
   "metadata": {},
   "source": [
    "> 3. 字典的删除\n",
    ">> 1. D.pop() 一般操作如下：\n",
    ">>> 1. 先查询是否存在 in \n",
    ">>> 2. 再使用删除的方法\n",
    ">> 2. D.popitem 随机删除（一般存在于相同元素）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "ad4c213f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function pop:\n",
      "\n",
      "pop(...) method of builtins.dict instance\n",
      "    D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\n",
      "    If key is not found, d is returned if given, otherwise KeyError is raised\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(stu_info.pop)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "0c1fd650",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "pop expected at least 1 argument, got 0",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-11-d1ada3d451b0>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mstu_info\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# 不正确，不同于列表（删除最后一个）\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m: pop expected at least 1 argument, got 0"
     ]
    }
   ],
   "source": [
    "stu_info.pop() # 不正确，不同于列表（删除最后一个）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "502a6184",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 字典删除的正确使用\n",
    "if 'stu1803' in stu_info:\n",
    "    stu_info.pop('stu1803')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "b1e31d10",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'stu1801': 'ZiQi', 'stu1802': 'XiaoFeng'}"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stu_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "67bb6c20",
   "metadata": {},
   "outputs": [
    {
     "ename": "KeyError",
     "evalue": "'stu1804'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mKeyError\u001b[0m                                  Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-14-d24be3ed36d5>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[1;31m# 如果不先查询 key 是否存在，有可能报错：KeyError: '1804'\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mstu_info\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"stu1804\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mKeyError\u001b[0m: 'stu1804'"
     ]
    }
   ],
   "source": [
    "# 如果不先查询 key 是否存在，有可能报错：KeyError: '1804'\n",
    "stu_info.pop(\"stu1804\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "f6bb93ad",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function popitem:\n",
      "\n",
      "popitem() method of builtins.dict instance\n",
      "    Remove and return a (key, value) pair as a 2-tuple.\n",
      "    \n",
      "    Pairs are returned in LIFO (last-in, first-out) order.\n",
      "    Raises KeyError if the dict is empty.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(stu_info.popitem) #移除并且返回元组 删除就删除了"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "8f64743b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('stu1802', 'XiaoFeng')"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stu_info.popitem()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "02bbbf14",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'stu1801': 'ZiQi'}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stu_info"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "01b1ee17",
   "metadata": {},
   "source": [
    "### 字典的实践（一）\n",
    "\n",
    "* 课本案例"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "c44a1930",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Provide a word to search for vowels:hello world\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'a': 0, 'e': 1, 'i': 0, 'o': 2, 'u': 0}"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 目标：查询 元音字母是否出现在word文本当中，并且统计出现的次数\n",
    "vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n",
    "word = input(\"Provide a word to search for vowels:\")\n",
    "found = {}\n",
    "\n",
    "#字典 初始化 的值   第一种方法\n",
    "# found[\"a\"]=0        #将元音计数初始化为0\n",
    "# found[\"e\"]=0\n",
    "# found[\"i\"]=0\n",
    "# found[\"o\"]=0\n",
    "# found[\"u\"]=0\n",
    "\n",
    "for i in vowels:\n",
    "    #使用字典的新增  构建初始化字典（第二种方法）\n",
    "    found[i] = 0\n",
    "\n",
    "# 循环用户输入的文本，出现一次元音字符，对应元音字符+1\n",
    "for i in word:\n",
    "    if i in vowels:\n",
    "        found[i] +=1\n",
    "found"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "91fd1ab5",
   "metadata": {},
   "source": [
    "> 字典的进阶方法：初始化所有值 fromkeys（）\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "fbb6a71e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function fromkeys:\n",
      "\n",
      "fromkeys(iterable, value=None, /) method of builtins.type instance\n",
      "    Create a new dictionary with keys from iterable and values set to value.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(found.fromkeys)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "4bfc9ceb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Provide a word to search for vowels:hello world\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'a': 0, 'e': 1, 'i': 0, 'o': 2, 'u': 0}"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n",
    "word = input(\"Provide a word to search for vowels:\")\n",
    "found = {}\n",
    "\n",
    "# found.fromkeys(vowels) \n",
    "# 初始化 字典，让其初始值为0\n",
    "found = found.fromkeys(vowels,0)\n",
    "\n",
    "for i in word:\n",
    "    if i in vowels:\n",
    "        found[i] +=1\n",
    "found"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "02cdedf5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'a': 0, 'e': 1, 'i': 0, 'o': 2, 'u': 0}"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "found"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "02ef36b9",
   "metadata": {},
   "source": [
    "> 字典的进阶方法：初始化特点的值 setdefault()\n",
    ">> * 查询 key 是否出现在字典中\n",
    ">>> 1. 出现过，就当没看见，不做任何操作\n",
    ">>> 2. key未出现过，给定key及value（指定的初始化的值）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "dc9ef60f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function setdefault:\n",
      "\n",
      "setdefault(key, default=None, /) method of builtins.dict instance\n",
      "    Insert key with a value of default if key is not in the dictionary.\n",
      "    \n",
      "    Return the value for key if key is in the dictionary, else default.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(found.setdefault)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "0aa72db5",
   "metadata": {},
   "outputs": [],
   "source": [
    "url = {\n",
    "    \"百度\":\"baidu.com\"\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "c7c4acd7",
   "metadata": {},
   "outputs": [],
   "source": [
    "stu_password = {\n",
    "    \"XiaoMing\":\"222333\"\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "ce3ffc5e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'123456'"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stu_password.setdefault(\"lihua\",\"123456\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "b3a0a11f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'123456'"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stu_password.setdefault(\"xiaohong\",\"123456\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "a189837d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'222333'"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stu_password.setdefault(\"XiaoMing\",\"123456\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "62b30e6a",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'XiaoMing': '222333', 'lihua': '123456', 'xiaohong': '123456'}"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stu_password"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "26df810f",
   "metadata": {},
   "source": [
    "### 字典的实践（二）\n",
    "\n",
    "* 课本p121"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "c3ac59c3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Provide a word to search for vowels:hello world\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'e': 1, 'o': 2}"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 优化：实践（一）\n",
    "\n",
    "vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n",
    "word = input(\"Provide a word to search for vowels:\")\n",
    "found = {}\n",
    "\n",
    "for i in word:\n",
    "    if i in vowels:\n",
    "        found.setdefault(i,0) # 特点情况下（字典中不存在该元素，初始化其值）\n",
    "        found[i] +=1\n",
    "found"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "485f6522",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'e': 1, 'o': 2, 'i': 1, 'a': 1}"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "{'e':1,'o':2,'i':1,'a':1}"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8f3cc6bc",
   "metadata": {},
   "source": [
    "* 实践\n",
    "> 1. 使用help查看字典的其他方法\n",
    "> 2. 尝试每一种方法的使用实践\n",
    "> 3. 用表格记录每一种方法的如何使用、注意事项、使用结果"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "eeafd105",
   "metadata": {},
   "source": [
    "| 字典的方法 | Description | 具体使用 | 注意事项 |\n",
    "| :----------| :----------| :----------| :----------|\n",
    "| pop() | 给定一个存在的key，可以进行对应成员(key及value)的删除 | D.pop(k[,d]) -> v | 需先查询 key 是否存在key值必须给出。 否则，返回default值。（删除最后一个）|\n",
    "| popitem() | 返回并删除字典中的最后一对键和值, 随机删除（一般存在于相同元素 | D.popitem(k,v) | 删除了就无法找回 |\n",
    "| setdefault() | 查询 key 是否出现在字典中,出现过，就当没看见，不做任何操作;key未出现过，给定key及value（指定的初始化的值）|D.setdefault(k[,d]) | 如果已有默认值则无法改变不会覆盖旧的值，特殊情况下（字典中不存在该元素，初始化其值）|\n",
    "| get() | 返回指定键的值,字典的查询 | D.get(k,d)| 当关键词key不存在时：返回zone不存在。不会报错 |\n",
    "| fromkeys（）| 初始化所有值，创建一个新字典，以序列 seq 中元素做字典的键，val 为字典所有键对应的初始值 | D.fromkeys（需初始化列表名称，需初始化值） | 需注意初始化后循环数值|\n",
    "| clear() | 删除字典内所有元素 | D.clear() | 谨慎使用，使用结果是全部清除 |\n",
    "| items() | 以列表返回可遍历的(键, 值) 元组数组 | D.items() | 使用时注意需要遍历的元素 |\n",
    "| keys() | 以列表返回一个字典所有的键,查看keys键 | D.keys() | 注意是否还有下级keys键 |\n",
    "| values() | 以列表返回字典中的所有值,查询values | D.valus() | \n",
    "| update() | 一个字典项更新另外一个字典，提供的字典中的项会被添加到旧的字典中。| D.update(k,v) | 若有相同的项则会进行覆盖。|\n",
    "| copy() | copy方法返回一个具有相同键—值对的新字典 | D.copy() | 在副本中替换值的时候原始字典不受影响，但是当修改副本中的值的时候原始字典也会改变。|"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "b0cf9d44",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on NoneType object:\n",
      "\n",
      "class NoneType(object)\n",
      " |  Methods defined here:\n",
      " |  \n",
      " |  __bool__(self, /)\n",
      " |      self != 0\n",
      " |  \n",
      " |  __repr__(self, /)\n",
      " |      Return repr(self).\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Static methods defined here:\n",
      " |  \n",
      " |  __new__(*args, **kwargs) from builtins.type\n",
      " |      Create and return a new object.  See help(type) for accurate signature.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(found.update())"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cc6052ff",
   "metadata": {},
   "source": [
    "## 字典的实践（三）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "d9d956e3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Ford': {'Name': 'Ford Prefect',\n",
       "  'Gender': 'Male',\n",
       "  'Occupation': 'Researcher',\n",
       "  'Home Planet': 'Betelgeuse Seven'},\n",
       " 'Arthur': {'Name': 'Arthur Dent',\n",
       "  'Gender': 'Male',\n",
       "  'Occupation': 'Sandwich-Maker',\n",
       "  'Home Planet': 'Earth'},\n",
       " 'Tricia': {'Name': 'Tricia McMillan',\n",
       "  'Gender': 'Female',\n",
       "  'Occupation': 'Mathematician',\n",
       "  'Home Planet': 'Earth'},\n",
       " 'Marvin': {'Name': 'Marvin',\n",
       "  'Gender': 'Unknown',\n",
       "  'Occupation': 'Paranoid Android',\n",
       "  'Home Planet': 'Unknown'}}"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "people = {}\n",
    "people['Ford'] = {\"Name\":'Ford Prefect',\n",
    "                  \"Gender\":'Male',\n",
    "                  \"Occupation\":'Researcher',\n",
    "                  \"Home Planet\":'Betelgeuse Seven'}\n",
    "people['Arthur'] = {\"Name\":'Arthur Dent',\n",
    "                  \"Gender\":'Male',\n",
    "                  \"Occupation\":'Sandwich-Maker',\n",
    "                  \"Home Planet\":'Earth'}\n",
    "people['Tricia'] = {\"Name\":'Tricia McMillan',\n",
    "                    \"Gender\":'Female',\n",
    "                    \"Occupation\":'Mathematician',\n",
    "                    \"Home Planet\":'Earth'}\n",
    "people['Marvin'] = {\"Name\":'Marvin',\n",
    "                    \"Gender\":'Unknown',\n",
    "                    \"Occupation\":'Paranoid Android',\n",
    "                    \"Home Planet\":'Unknown'}\n",
    "people"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "501a960b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Tricia McMillan'"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 任务：查找并取值 'Tricia McMillan'\n",
    "\n",
    "people['Tricia']['Name']"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e960541f",
   "metadata": {},
   "source": [
    "* 课后实践\n",
    "> 1. 请找出 id 为 'B0HGD588HJ' 的 信息(第一题如上)\n",
    "> 2. 请找出所有的 pois 中的字典元素 的 id，存到一个id列表中\n",
    "> 3. 请找出所有的 pois 中的字典元素 的 name，存到一个 id 列表中\n",
    "> 4. 请找出所有的 name 以及 location 做一个字典 （name_dict = {name1:location1 , name2:location2...}）\n",
    "> 5. 请找出所有 含有 'tel' 的元素\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "4339050f",
   "metadata": {},
   "outputs": [],
   "source": [
    "广州南方学院 = {'status': '1',\n",
    " 'regeocode': {'roads': [{'id': '020F49F0050461206',\n",
    "    'location': '113.678,23.6284',\n",
    "    'direction': '北',\n",
    "    'name': '博学路',\n",
    "    'distance': '7.63232'},\n",
    "   {'id': '020F49F0050462229',\n",
    "    'location': '113.679,23.6245',\n",
    "    'direction': '北',\n",
    "    'name': '老虎形街',\n",
    "    'distance': '445.159'},\n",
    "   {'id': '020F49F0050462451',\n",
    "    'location': '113.677,23.6347',\n",
    "    'direction': '南',\n",
    "    'name': '中山路',\n",
    "    'distance': '708.299'}],\n",
    "  'roadinters': [{'second_name': '中山路',\n",
    "    'first_id': '020F49F0050461206',\n",
    "    'second_id': '020F49F0050462451',\n",
    "    'location': '113.676794,23.634661',\n",
    "    'distance': '708.299',\n",
    "    'first_name': '博学路',\n",
    "    'direction': '南'}],\n",
    "  'formatted_address': '广东省广州市从化区温泉镇博学路',\n",
    "  'addressComponent': {'city': '广州市',\n",
    "   'province': '广东省',\n",
    "   'adcode': '440117',\n",
    "   'district': '从化区',\n",
    "   'towncode': '440117100000',\n",
    "   'streetNumber': {'number': '24号',\n",
    "    'location': '113.677267,23.629149',\n",
    "    'direction': '西北',\n",
    "    'distance': '129.943',\n",
    "    'street': '博学路'},\n",
    "   'country': '中国',\n",
    "   'township': '温泉镇',\n",
    "   'businessAreas': [[]],\n",
    "   'building': {'name': [], 'type': []},\n",
    "   'neighborhood': {'name': [], 'type': []},\n",
    "   'citycode': '020'},\n",
    "  'aois': [],\n",
    "  'pois': [{'id': 'B0FFG4TAF2',\n",
    "    'direction': '东南',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉镇乌土村松浪队5号(近博学路)',\n",
    "    'poiweight': '0.237309',\n",
    "    'name': '广州南方公寓',\n",
    "    'location': '113.678983,23.627778',\n",
    "    'distance': '102.617',\n",
    "    'tel': '13622768437',\n",
    "    'type': '商务住宅;住宅区;住宅小区'},\n",
    "   {'id': 'B0H6FA18J5',\n",
    "    'direction': '东南',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院南侧)',\n",
    "    'poiweight': '0.223065',\n",
    "    'name': '保利半山花园',\n",
    "    'location': '113.679358,23.627672',\n",
    "    'distance': '139.054',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;住宅区'},\n",
    "   {'id': 'B00140TWHT',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '笃行路2',\n",
    "    'poiweight': '0.157653',\n",
    "    'name': '教工住宅1号',\n",
    "    'location': '113.678490,23.630432',\n",
    "    'distance': '222.658',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;住宅小区'},\n",
    "   {'id': 'B0FFHRJDM9',\n",
    "    'direction': '东南',\n",
    "    'businessarea': [],\n",
    "    'address': '中大南方学院南门1号',\n",
    "    'poiweight': '0.256152',\n",
    "    'name': '中南公寓',\n",
    "    'location': '113.680349,23.627573',\n",
    "    'distance': '231.723',\n",
    "    'tel': '13711245345',\n",
    "    'type': '商务住宅;住宅区;住宅小区'},\n",
    "   {'id': 'B0HGD588HJ',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼4号',\n",
    "    'location': '113.677460,23.630490',\n",
    "    'distance': '242.901',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFHZH0IK',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路广州南方学院综合楼内',\n",
    "    'poiweight': '0.17934',\n",
    "    'name': '地下铁',\n",
    "    'location': '113.677941,23.629029',\n",
    "    'distance': '74.1376',\n",
    "    'tel': [],\n",
    "    'type': '餐饮服务;冷饮店;冷饮店'},\n",
    "   {'id': 'B0HGDU76L2',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院2号实验楼',\n",
    "    'location': '113.678211,23.630956',\n",
    "    'distance': '280.003',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFKP838K',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路25',\n",
    "    'poiweight': '0.191742',\n",
    "    'name': '教学楼3号(外国语学院)',\n",
    "    'location': '113.677247,23.630947',\n",
    "    'distance': '298.093',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;高等院校'},\n",
    "   {'id': 'B0HGDU8NLD',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路附近',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院1号实验楼',\n",
    "    'location': '113.678215,23.631370',\n",
    "    'distance': '326.007',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD58UTU',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.191229',\n",
    "    'name': '广州南方学院2号教学楼',\n",
    "    'location': '113.677060,23.631346',\n",
    "    'distance': '346.352',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B00140MR9A',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号',\n",
    "    'poiweight': '0.450402',\n",
    "    'name': '广州南方学院',\n",
    "    'location': '113.679262,23.632583',\n",
    "    'distance': '471.564',\n",
    "    'tel': '020-87828988;020-61787331',\n",
    "    'type': '科教文化服务;学校;高等院校'},\n",
    "   {'id': 'B0HGDU92JD',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': [],\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼1号',\n",
    "    'location': '113.677077,23.631783',\n",
    "    'distance': '391.548',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD592BJ',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道886号广州南方学院内',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院综合楼',\n",
    "    'location': '113.680117,23.631544',\n",
    "    'distance': '392.731',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFKP81F0',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路19号附近',\n",
    "    'poiweight': '0.191742',\n",
    "    'name': '教学楼1号(文学与传媒学院)',\n",
    "    'location': '113.676866,23.631736',\n",
    "    'distance': '393.93',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
    "   {'id': 'B0FFLBEOND',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院)',\n",
    "    'poiweight': '0.190963',\n",
    "    'name': '聚贤楼10号',\n",
    "    'location': '113.681253,23.631036',\n",
    "    'distance': '418.51',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;宿舍'},\n",
    "   {'id': 'B0FFH6K3U9',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉镇温泉大道882号广州南方学院H7栋1-5层',\n",
    "    'poiweight': '0.254885',\n",
    "    'name': '广州中大南方招待所',\n",
    "    'location': '113.676330,23.631332',\n",
    "    'distance': '378.102',\n",
    "    'tel': '020-61787222',\n",
    "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
    "   {'id': 'B0HGD58NF8',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院新综合楼2层',\n",
    "    'poiweight': '0.191229',\n",
    "    'name': '广州南方学院达人书院',\n",
    "    'location': '113.679041,23.632392',\n",
    "    'distance': '446.366',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
    "   {'id': 'B0FFKUVYWV',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '保利桃花源',\n",
    "    'poiweight': '0.273168',\n",
    "    'name': '广州和风庭阿七度假别墅',\n",
    "    'location': '113.681736,23.630569',\n",
    "    'distance': '424.35',\n",
    "    'tel': '18681565305',\n",
    "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
    "   {'id': 'B0HGDU99RM',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院内',\n",
    "    'poiweight': '0.257947',\n",
    "    'name': '广州南方学院图书馆',\n",
    "    'location': '113.679177,23.632762',\n",
    "    'distance': '489.331',\n",
    "    'tel': '020-61787368;020-61787371',\n",
    "    'type': '科教文化服务;图书馆;图书馆'},\n",
    "   {'id': 'B0HGDU92JC',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路附近',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院4号实验楼',\n",
    "    'location': '113.679963,23.632652',\n",
    "    'distance': '498.883',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFL7C054',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
    "    'poiweight': '0.317505',\n",
    "    'name': '广州U优森特酒店',\n",
    "    'location': '113.679226,23.632528',\n",
    "    'distance': '464.819',\n",
    "    'tel': '15813395296',\n",
    "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
    "   {'id': 'B0FFG8CSEK',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院)',\n",
    "    'poiweight': '0.185371',\n",
    "    'name': 'L5员工宿舍',\n",
    "    'location': '113.682583,23.631487',\n",
    "    'distance': '554.129',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;宿舍'},\n",
    "   {'id': 'B0HGD58FR2',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '广州南方学院',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼9号',\n",
    "    'location': '113.679747,23.633032',\n",
    "    'distance': '532.163',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HG5Z9JNK',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.221553',\n",
    "    'name': '广州南方学院教学楼7号',\n",
    "    'location': '113.678600,23.633330',\n",
    "    'distance': '544.868',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD599JM',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院第11教学楼',\n",
    "    'location': '113.680037,23.633173',\n",
    "    'distance': '556.036',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0GUJYPEG2',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院内博学路6号之3',\n",
    "    'poiweight': '0.216026',\n",
    "    'name': '怒烤烤串(从化店)',\n",
    "    'location': '113.677160,23.632910',\n",
    "    'distance': '510.112',\n",
    "    'tel': [],\n",
    "    'type': '餐饮服务;中餐厅;特色/地方风味餐厅'},\n",
    "   {'id': 'B0HGDU6Z41',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼6号',\n",
    "    'location': '113.678424,23.633710',\n",
    "    'distance': '586.331',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD580NZ',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路7号附近',\n",
    "    'poiweight': '0.285712',\n",
    "    'name': '广州南方学院惟贤门',\n",
    "    'location': '113.678437,23.633721',\n",
    "    'distance': '587.601',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;高等院校'},\n",
    "   {'id': 'B0HGDU7T1K',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院)',\n",
    "    'poiweight': '0.191229',\n",
    "    'name': '广州南方学院教学楼10号',\n",
    "    'location': '113.680125,23.633492',\n",
    "    'distance': '592.504',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
    "   {'id': 'B0HGDU76L1',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '中山路与博学路交叉口东南150米',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼5号',\n",
    "    'location': '113.678046,23.633982',\n",
    "    'distance': '616.848',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'}]},\n",
    " 'info': 'OK',\n",
    " 'infocode': '10000'}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "8c2043d0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'regeocode': {'roads': [{'id': '020F49F0050461206',\n",
       "    'location': '113.678,23.6284',\n",
       "    'direction': '北',\n",
       "    'name': '博学路',\n",
       "    'distance': '7.63232'},\n",
       "   {'id': '020F49F0050462229',\n",
       "    'location': '113.679,23.6245',\n",
       "    'direction': '北',\n",
       "    'name': '老虎形街',\n",
       "    'distance': '445.159'},\n",
       "   {'id': '020F49F0050462451',\n",
       "    'location': '113.677,23.6347',\n",
       "    'direction': '南',\n",
       "    'name': '中山路',\n",
       "    'distance': '708.299'}],\n",
       "  'roadinters': [{'second_name': '中山路',\n",
       "    'first_id': '020F49F0050461206',\n",
       "    'second_id': '020F49F0050462451',\n",
       "    'location': '113.676794,23.634661',\n",
       "    'distance': '708.299',\n",
       "    'first_name': '博学路',\n",
       "    'direction': '南'}],\n",
       "  'formatted_address': '广东省广州市从化区温泉镇博学路',\n",
       "  'addressComponent': {'city': '广州市',\n",
       "   'province': '广东省',\n",
       "   'adcode': '440117',\n",
       "   'district': '从化区',\n",
       "   'towncode': '440117100000',\n",
       "   'streetNumber': {'number': '24号',\n",
       "    'location': '113.677267,23.629149',\n",
       "    'direction': '西北',\n",
       "    'distance': '129.943',\n",
       "    'street': '博学路'},\n",
       "   'country': '中国',\n",
       "   'township': '温泉镇',\n",
       "   'businessAreas': [[]],\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'citycode': '020'},\n",
       "  'aois': [],\n",
       "  'pois': [{'id': 'B0FFG4TAF2',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇乌土村松浪队5号(近博学路)',\n",
       "    'poiweight': '0.237309',\n",
       "    'name': '广州南方公寓',\n",
       "    'location': '113.678983,23.627778',\n",
       "    'distance': '102.617',\n",
       "    'tel': '13622768437',\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0H6FA18J5',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院南侧)',\n",
       "    'poiweight': '0.223065',\n",
       "    'name': '保利半山花园',\n",
       "    'location': '113.679358,23.627672',\n",
       "    'distance': '139.054',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅区'},\n",
       "   {'id': 'B00140TWHT',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '笃行路2',\n",
       "    'poiweight': '0.157653',\n",
       "    'name': '教工住宅1号',\n",
       "    'location': '113.678490,23.630432',\n",
       "    'distance': '222.658',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0FFHRJDM9',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '中大南方学院南门1号',\n",
       "    'poiweight': '0.256152',\n",
       "    'name': '中南公寓',\n",
       "    'location': '113.680349,23.627573',\n",
       "    'distance': '231.723',\n",
       "    'tel': '13711245345',\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0HGD588HJ',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼4号',\n",
       "    'location': '113.677460,23.630490',\n",
       "    'distance': '242.901',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFHZH0IK',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路广州南方学院综合楼内',\n",
       "    'poiweight': '0.17934',\n",
       "    'name': '地下铁',\n",
       "    'location': '113.677941,23.629029',\n",
       "    'distance': '74.1376',\n",
       "    'tel': [],\n",
       "    'type': '餐饮服务;冷饮店;冷饮店'},\n",
       "   {'id': 'B0HGDU76L2',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院2号实验楼',\n",
       "    'location': '113.678211,23.630956',\n",
       "    'distance': '280.003',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFKP838K',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路25',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼3号(外国语学院)',\n",
       "    'location': '113.677247,23.630947',\n",
       "    'distance': '298.093',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0HGDU8NLD',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院1号实验楼',\n",
       "    'location': '113.678215,23.631370',\n",
       "    'distance': '326.007',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD58UTU',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.191229',\n",
       "    'name': '广州南方学院2号教学楼',\n",
       "    'location': '113.677060,23.631346',\n",
       "    'distance': '346.352',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B00140MR9A',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号',\n",
       "    'poiweight': '0.450402',\n",
       "    'name': '广州南方学院',\n",
       "    'location': '113.679262,23.632583',\n",
       "    'distance': '471.564',\n",
       "    'tel': '020-87828988;020-61787331',\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0HGDU92JD',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': [],\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼1号',\n",
       "    'location': '113.677077,23.631783',\n",
       "    'distance': '391.548',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD592BJ',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道886号广州南方学院内',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院综合楼',\n",
       "    'location': '113.680117,23.631544',\n",
       "    'distance': '392.731',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFKP81F0',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路19号附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼1号(文学与传媒学院)',\n",
       "    'location': '113.676866,23.631736',\n",
       "    'distance': '393.93',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFLBEOND',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.190963',\n",
       "    'name': '聚贤楼10号',\n",
       "    'location': '113.681253,23.631036',\n",
       "    'distance': '418.51',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0FFH6K3U9',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇温泉大道882号广州南方学院H7栋1-5层',\n",
       "    'poiweight': '0.254885',\n",
       "    'name': '广州中大南方招待所',\n",
       "    'location': '113.676330,23.631332',\n",
       "    'distance': '378.102',\n",
       "    'tel': '020-61787222',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0HGD58NF8',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院新综合楼2层',\n",
       "    'poiweight': '0.191229',\n",
       "    'name': '广州南方学院达人书院',\n",
       "    'location': '113.679041,23.632392',\n",
       "    'distance': '446.366',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKUVYWV',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '保利桃花源',\n",
       "    'poiweight': '0.273168',\n",
       "    'name': '广州和风庭阿七度假别墅',\n",
       "    'location': '113.681736,23.630569',\n",
       "    'distance': '424.35',\n",
       "    'tel': '18681565305',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0HGDU99RM',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院内',\n",
       "    'poiweight': '0.257947',\n",
       "    'name': '广州南方学院图书馆',\n",
       "    'location': '113.679177,23.632762',\n",
       "    'distance': '489.331',\n",
       "    'tel': '020-61787368;020-61787371',\n",
       "    'type': '科教文化服务;图书馆;图书馆'},\n",
       "   {'id': 'B0HGDU92JC',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院4号实验楼',\n",
       "    'location': '113.679963,23.632652',\n",
       "    'distance': '498.883',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFL7C054',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
       "    'poiweight': '0.317505',\n",
       "    'name': '广州U优森特酒店',\n",
       "    'location': '113.679226,23.632528',\n",
       "    'distance': '464.819',\n",
       "    'tel': '15813395296',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0FFG8CSEK',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.185371',\n",
       "    'name': 'L5员工宿舍',\n",
       "    'location': '113.682583,23.631487',\n",
       "    'distance': '554.129',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0HGD58FR2',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '广州南方学院',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼9号',\n",
       "    'location': '113.679747,23.633032',\n",
       "    'distance': '532.163',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HG5Z9JNK',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221553',\n",
       "    'name': '广州南方学院教学楼7号',\n",
       "    'location': '113.678600,23.633330',\n",
       "    'distance': '544.868',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD599JM',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院第11教学楼',\n",
       "    'location': '113.680037,23.633173',\n",
       "    'distance': '556.036',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0GUJYPEG2',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院内博学路6号之3',\n",
       "    'poiweight': '0.216026',\n",
       "    'name': '怒烤烤串(从化店)',\n",
       "    'location': '113.677160,23.632910',\n",
       "    'distance': '510.112',\n",
       "    'tel': [],\n",
       "    'type': '餐饮服务;中餐厅;特色/地方风味餐厅'},\n",
       "   {'id': 'B0HGDU6Z41',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼6号',\n",
       "    'location': '113.678424,23.633710',\n",
       "    'distance': '586.331',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD580NZ',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路7号附近',\n",
       "    'poiweight': '0.285712',\n",
       "    'name': '广州南方学院惟贤门',\n",
       "    'location': '113.678437,23.633721',\n",
       "    'distance': '587.601',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0HGDU7T1K',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.191229',\n",
       "    'name': '广州南方学院教学楼10号',\n",
       "    'location': '113.680125,23.633492',\n",
       "    'distance': '592.504',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0HGDU76L1',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路与博学路交叉口东南150米',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼5号',\n",
       "    'location': '113.678046,23.633982',\n",
       "    'distance': '616.848',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'}]},\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000'}"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "742afa78",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['status', 'regeocode', 'info', 'infocode'])"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "36fd49cd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'1'"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院['status']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "e7cbe4b2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['roads', 'roadinters', 'formatted_address', 'addressComponent', 'aois', 'pois'])"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院['regeocode'].keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "id": "d281c1a7",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'list' object has no attribute 'keys'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-106-6f1acb3739f9>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0m广州南方学院\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'regeocode'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'roads'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mkeys\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m: 'list' object has no attribute 'keys'"
     ]
    }
   ],
   "source": [
    "广州南方学院['regeocode']['roads']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "9df1dedf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'second_name': '中山路',\n",
       "  'first_id': '020F49F0050461206',\n",
       "  'second_id': '020F49F0050462451',\n",
       "  'location': '113.676794,23.634661',\n",
       "  'distance': '708.299',\n",
       "  'first_name': '博学路',\n",
       "  'direction': '南'}]"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院['regeocode']['roadinters']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "4e2c7894",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'广东省广州市从化区温泉镇博学路'"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院['regeocode']['formatted_address']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "fbb3a487",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'city': '广州市',\n",
       " 'province': '广东省',\n",
       " 'adcode': '440117',\n",
       " 'district': '从化区',\n",
       " 'towncode': '440117100000',\n",
       " 'streetNumber': {'number': '24号',\n",
       "  'location': '113.677267,23.629149',\n",
       "  'direction': '西北',\n",
       "  'distance': '129.943',\n",
       "  'street': '博学路'},\n",
       " 'country': '中国',\n",
       " 'township': '温泉镇',\n",
       " 'businessAreas': [[]],\n",
       " 'building': {'name': [], 'type': []},\n",
       " 'neighborhood': {'name': [], 'type': []},\n",
       " 'citycode': '020'}"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院['regeocode']['addressComponent']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "afc9c893",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[]"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院['regeocode']['aois']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "7cf9e681",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'id': 'B0FFG4TAF2',\n",
       "  'direction': '东南',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉镇乌土村松浪队5号(近博学路)',\n",
       "  'poiweight': '0.237309',\n",
       "  'name': '广州南方公寓',\n",
       "  'location': '113.678983,23.627778',\n",
       "  'distance': '102.617',\n",
       "  'tel': '13622768437',\n",
       "  'type': '商务住宅;住宅区;住宅小区'},\n",
       " {'id': 'B0H6FA18J5',\n",
       "  'direction': '东南',\n",
       "  'businessarea': [],\n",
       "  'address': '从莞深高速(广州南方学院南侧)',\n",
       "  'poiweight': '0.223065',\n",
       "  'name': '保利半山花园',\n",
       "  'location': '113.679358,23.627672',\n",
       "  'distance': '139.054',\n",
       "  'tel': [],\n",
       "  'type': '商务住宅;住宅区;住宅区'},\n",
       " {'id': 'B00140TWHT',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '笃行路2',\n",
       "  'poiweight': '0.157653',\n",
       "  'name': '教工住宅1号',\n",
       "  'location': '113.678490,23.630432',\n",
       "  'distance': '222.658',\n",
       "  'tel': [],\n",
       "  'type': '商务住宅;住宅区;住宅小区'},\n",
       " {'id': 'B0FFHRJDM9',\n",
       "  'direction': '东南',\n",
       "  'businessarea': [],\n",
       "  'address': '中大南方学院南门1号',\n",
       "  'poiweight': '0.256152',\n",
       "  'name': '中南公寓',\n",
       "  'location': '113.680349,23.627573',\n",
       "  'distance': '231.723',\n",
       "  'tel': '13711245345',\n",
       "  'type': '商务住宅;住宅区;住宅小区'},\n",
       " {'id': 'B0HGD588HJ',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院教学楼4号',\n",
       "  'location': '113.677460,23.630490',\n",
       "  'distance': '242.901',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0FFHZH0IK',\n",
       "  'direction': '西北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路广州南方学院综合楼内',\n",
       "  'poiweight': '0.17934',\n",
       "  'name': '地下铁',\n",
       "  'location': '113.677941,23.629029',\n",
       "  'distance': '74.1376',\n",
       "  'tel': [],\n",
       "  'type': '餐饮服务;冷饮店;冷饮店'},\n",
       " {'id': 'B0HGDU76L2',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院2号实验楼',\n",
       "  'location': '113.678211,23.630956',\n",
       "  'distance': '280.003',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0FFKP838K',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路25',\n",
       "  'poiweight': '0.191742',\n",
       "  'name': '教学楼3号(外国语学院)',\n",
       "  'location': '113.677247,23.630947',\n",
       "  'distance': '298.093',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;高等院校'},\n",
       " {'id': 'B0HGDU8NLD',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路附近',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院1号实验楼',\n",
       "  'location': '113.678215,23.631370',\n",
       "  'distance': '326.007',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0HGD58UTU',\n",
       "  'direction': '西北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路',\n",
       "  'poiweight': '0.191229',\n",
       "  'name': '广州南方学院2号教学楼',\n",
       "  'location': '113.677060,23.631346',\n",
       "  'distance': '346.352',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B00140MR9A',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882号',\n",
       "  'poiweight': '0.450402',\n",
       "  'name': '广州南方学院',\n",
       "  'location': '113.679262,23.632583',\n",
       "  'distance': '471.564',\n",
       "  'tel': '020-87828988;020-61787331',\n",
       "  'type': '科教文化服务;学校;高等院校'},\n",
       " {'id': 'B0HGDU92JD',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': [],\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院教学楼1号',\n",
       "  'location': '113.677077,23.631783',\n",
       "  'distance': '391.548',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0HGD592BJ',\n",
       "  'direction': '东北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道886号广州南方学院内',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院综合楼',\n",
       "  'location': '113.680117,23.631544',\n",
       "  'distance': '392.731',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0FFKP81F0',\n",
       "  'direction': '西北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路19号附近',\n",
       "  'poiweight': '0.191742',\n",
       "  'name': '教学楼1号(文学与传媒学院)',\n",
       "  'location': '113.676866,23.631736',\n",
       "  'distance': '393.93',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       " {'id': 'B0FFLBEOND',\n",
       "  'direction': '东北',\n",
       "  'businessarea': [],\n",
       "  'address': '从莞深高速(广州南方学院)',\n",
       "  'poiweight': '0.190963',\n",
       "  'name': '聚贤楼10号',\n",
       "  'location': '113.681253,23.631036',\n",
       "  'distance': '418.51',\n",
       "  'tel': [],\n",
       "  'type': '商务住宅;住宅区;宿舍'},\n",
       " {'id': 'B0FFH6K3U9',\n",
       "  'direction': '西北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉镇温泉大道882号广州南方学院H7栋1-5层',\n",
       "  'poiweight': '0.254885',\n",
       "  'name': '广州中大南方招待所',\n",
       "  'location': '113.676330,23.631332',\n",
       "  'distance': '378.102',\n",
       "  'tel': '020-61787222',\n",
       "  'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       " {'id': 'B0HGD58NF8',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882号广州南方学院新综合楼2层',\n",
       "  'poiweight': '0.191229',\n",
       "  'name': '广州南方学院达人书院',\n",
       "  'location': '113.679041,23.632392',\n",
       "  'distance': '446.366',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       " {'id': 'B0FFKUVYWV',\n",
       "  'direction': '东北',\n",
       "  'businessarea': [],\n",
       "  'address': '保利桃花源',\n",
       "  'poiweight': '0.273168',\n",
       "  'name': '广州和风庭阿七度假别墅',\n",
       "  'location': '113.681736,23.630569',\n",
       "  'distance': '424.35',\n",
       "  'tel': '18681565305',\n",
       "  'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       " {'id': 'B0HGDU99RM',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882号广州南方学院内',\n",
       "  'poiweight': '0.257947',\n",
       "  'name': '广州南方学院图书馆',\n",
       "  'location': '113.679177,23.632762',\n",
       "  'distance': '489.331',\n",
       "  'tel': '020-61787368;020-61787371',\n",
       "  'type': '科教文化服务;图书馆;图书馆'},\n",
       " {'id': 'B0HGDU92JC',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路附近',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院4号实验楼',\n",
       "  'location': '113.679963,23.632652',\n",
       "  'distance': '498.883',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0FFL7C054',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
       "  'poiweight': '0.317505',\n",
       "  'name': '广州U优森特酒店',\n",
       "  'location': '113.679226,23.632528',\n",
       "  'distance': '464.819',\n",
       "  'tel': '15813395296',\n",
       "  'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       " {'id': 'B0FFG8CSEK',\n",
       "  'direction': '东北',\n",
       "  'businessarea': [],\n",
       "  'address': '从莞深高速(广州南方学院)',\n",
       "  'poiweight': '0.185371',\n",
       "  'name': 'L5员工宿舍',\n",
       "  'location': '113.682583,23.631487',\n",
       "  'distance': '554.129',\n",
       "  'tel': [],\n",
       "  'type': '商务住宅;住宅区;宿舍'},\n",
       " {'id': 'B0HGD58FR2',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '广州南方学院',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院教学楼9号',\n",
       "  'location': '113.679747,23.633032',\n",
       "  'distance': '532.163',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0HG5Z9JNK',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路',\n",
       "  'poiweight': '0.221553',\n",
       "  'name': '广州南方学院教学楼7号',\n",
       "  'location': '113.678600,23.633330',\n",
       "  'distance': '544.868',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0HGD599JM',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882号广州南方学院',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院第11教学楼',\n",
       "  'location': '113.680037,23.633173',\n",
       "  'distance': '556.036',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0GUJYPEG2',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882号广州南方学院内博学路6号之3',\n",
       "  'poiweight': '0.216026',\n",
       "  'name': '怒烤烤串(从化店)',\n",
       "  'location': '113.677160,23.632910',\n",
       "  'distance': '510.112',\n",
       "  'tel': [],\n",
       "  'type': '餐饮服务;中餐厅;特色/地方风味餐厅'},\n",
       " {'id': 'B0HGDU6Z41',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院教学楼6号',\n",
       "  'location': '113.678424,23.633710',\n",
       "  'distance': '586.331',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0HGD580NZ',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路7号附近',\n",
       "  'poiweight': '0.285712',\n",
       "  'name': '广州南方学院惟贤门',\n",
       "  'location': '113.678437,23.633721',\n",
       "  'distance': '587.601',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;高等院校'},\n",
       " {'id': 'B0HGDU7T1K',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '从莞深高速(广州南方学院)',\n",
       "  'poiweight': '0.191229',\n",
       "  'name': '广州南方学院教学楼10号',\n",
       "  'location': '113.680125,23.633492',\n",
       "  'distance': '592.504',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       " {'id': 'B0HGDU76L1',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '中山路与博学路交叉口东南150米',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院教学楼5号',\n",
       "  'location': '113.678046,23.633982',\n",
       "  'distance': '616.848',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'}]"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院['regeocode']['pois']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "83980711",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "广州南方公寓\n",
      "保利半山花园\n",
      "教工住宅1号\n",
      "中南公寓\n",
      "广州南方学院教学楼4号\n",
      "地下铁\n",
      "广州南方学院2号实验楼\n",
      "教学楼3号(外国语学院)\n",
      "广州南方学院1号实验楼\n",
      "广州南方学院2号教学楼\n",
      "广州南方学院\n",
      "广州南方学院教学楼1号\n",
      "广州南方学院综合楼\n",
      "教学楼1号(文学与传媒学院)\n",
      "聚贤楼10号\n",
      "广州中大南方招待所\n",
      "广州南方学院达人书院\n",
      "广州和风庭阿七度假别墅\n",
      "广州南方学院图书馆\n",
      "广州南方学院4号实验楼\n",
      "广州U优森特酒店\n",
      "L5员工宿舍\n",
      "广州南方学院教学楼9号\n",
      "广州南方学院教学楼7号\n",
      "广州南方学院第11教学楼\n",
      "怒烤烤串(从化店)\n",
      "广州南方学院教学楼6号\n",
      "广州南方学院惟贤门\n",
      "广州南方学院教学楼10号\n",
      "广州南方学院教学楼5号\n"
     ]
    }
   ],
   "source": [
    "for i in 广州南方学院['regeocode']['pois']:\n",
    "    print(i['name'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "0d8dc8ca",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'id': 'B0HGD588HJ', 'direction': '北', 'businessarea': [], 'address': '博学路', 'poiweight': '0.221662', 'name': '广州南方学院教学楼4号', 'location': '113.677460,23.630490', 'distance': '242.901', 'tel': [], 'type': '科教文化服务;学校;学校'}\n"
     ]
    }
   ],
   "source": [
    "# 1. 请找出 id 为 'B0HGD588HJ' 的 信息(第一题如上)\n",
    "\n",
    "for i in 广州南方学院['regeocode']['pois']:\n",
    "    if i[\"id\"] == 'B0HGD588HJ':\n",
    "        print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "8810695e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['B0FFG4TAF2', 'B0H6FA18J5', 'B00140TWHT', 'B0FFHRJDM9', 'B0HGD588HJ', 'B0FFHZH0IK', 'B0HGDU76L2', 'B0FFKP838K', 'B0HGDU8NLD', 'B0HGD58UTU', 'B00140MR9A', 'B0HGDU92JD', 'B0HGD592BJ', 'B0FFKP81F0', 'B0FFLBEOND', 'B0FFH6K3U9', 'B0HGD58NF8', 'B0FFKUVYWV', 'B0HGDU99RM', 'B0HGDU92JC', 'B0FFL7C054', 'B0FFG8CSEK', 'B0HGD58FR2', 'B0HG5Z9JNK', 'B0HGD599JM', 'B0GUJYPEG2', 'B0HGDU6Z41', 'B0HGD580NZ', 'B0HGDU7T1K', 'B0HGDU76L1']\n"
     ]
    }
   ],
   "source": [
    "# 2. 请找出所有的 pois 中的字典元素 的 id，存到一个id列表中\n",
    "\n",
    "id = []\n",
    "for i in 广州南方学院['regeocode']['pois']:\n",
    "    id.append(i['id'])\n",
    "print(id)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "e7a5689e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['广州南方公寓', '保利半山花园', '教工住宅1号', '中南公寓', '广州南方学院教学楼4号', '地下铁', '广州南方学院2号实验楼', '教学楼3号(外国语学院)', '广州南方学院1号实验楼', '广州南方学院2号教学楼', '广州南方学院', '广州南方学院教学楼1号', '广州南方学院综合楼', '教学楼1号(文学与传媒学院)', '聚贤楼10号', '广州中大南方招待所', '广州南方学院达人书院', '广州和风庭阿七度假别墅', '广州南方学院图书馆', '广州南方学院4号实验楼', '广州U优森特酒店', 'L5员工宿舍', '广州南方学院教学楼9号', '广州南方学院教学楼7号', '广州南方学院第11教学楼', '怒烤烤串(从化店)', '广州南方学院教学楼6号', '广州南方学院惟贤门', '广州南方学院教学楼10号', '广州南方学院教学楼5号']\n"
     ]
    }
   ],
   "source": [
    "# 3. 请找出所有的 pois 中的字典元素 的 name，存到一个 name 列表中\n",
    "\n",
    "name = []\n",
    "for i in 广州南方学院['regeocode']['pois']:\n",
    "    name.append(i['name'])\n",
    "print(name)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "id": "8fc1dcfe",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['广州南方公寓', '113.678983,23.627778', '广州南方公寓', '113.678983,23.627778', '广州南方公寓', '113.678983,23.627778', '广州南方公寓', '113.678983,23.627778', '保利半山花园', '113.679358,23.627672', '保利半山花园', '113.679358,23.627672', '保利半山花园', '113.679358,23.627672', '保利半山花园', '113.679358,23.627672', '教工住宅1号', '113.678490,23.630432', '教工住宅1号', '113.678490,23.630432', '教工住宅1号', '113.678490,23.630432', '教工住宅1号', '113.678490,23.630432', '中南公寓', '113.680349,23.627573', '中南公寓', '113.680349,23.627573', '中南公寓', '113.680349,23.627573', '中南公寓', '113.680349,23.627573', '广州南方学院教学楼4号', '113.677460,23.630490', '广州南方学院教学楼4号', '113.677460,23.630490', '广州南方学院教学楼4号', '113.677460,23.630490', '广州南方学院教学楼4号', '113.677460,23.630490', '地下铁', '113.677941,23.629029', '地下铁', '113.677941,23.629029', '地下铁', '113.677941,23.629029', '地下铁', '113.677941,23.629029', '广州南方学院2号实验楼', '113.678211,23.630956', '广州南方学院2号实验楼', '113.678211,23.630956', '广州南方学院2号实验楼', '113.678211,23.630956', '广州南方学院2号实验楼', '113.678211,23.630956', '教学楼3号(外国语学院)', '113.677247,23.630947', '教学楼3号(外国语学院)', '113.677247,23.630947', '教学楼3号(外国语学院)', '113.677247,23.630947', '教学楼3号(外国语学院)', '113.677247,23.630947', '广州南方学院1号实验楼', '113.678215,23.631370', '广州南方学院1号实验楼', '113.678215,23.631370', '广州南方学院1号实验楼', '113.678215,23.631370', '广州南方学院1号实验楼', '113.678215,23.631370', '广州南方学院2号教学楼', '113.677060,23.631346', '广州南方学院2号教学楼', '113.677060,23.631346', '广州南方学院2号教学楼', '113.677060,23.631346', '广州南方学院2号教学楼', '113.677060,23.631346', '广州南方学院', '113.679262,23.632583', '广州南方学院', '113.679262,23.632583', '广州南方学院', '113.679262,23.632583', '广州南方学院', '113.679262,23.632583', '广州南方学院教学楼1号', '113.677077,23.631783', '广州南方学院教学楼1号', '113.677077,23.631783', '广州南方学院教学楼1号', '113.677077,23.631783', '广州南方学院教学楼1号', '113.677077,23.631783', '广州南方学院综合楼', '113.680117,23.631544', '广州南方学院综合楼', '113.680117,23.631544', '广州南方学院综合楼', '113.680117,23.631544', '广州南方学院综合楼', '113.680117,23.631544', '教学楼1号(文学与传媒学院)', '113.676866,23.631736', '教学楼1号(文学与传媒学院)', '113.676866,23.631736', '教学楼1号(文学与传媒学院)', '113.676866,23.631736', '教学楼1号(文学与传媒学院)', '113.676866,23.631736', '聚贤楼10号', '113.681253,23.631036', '聚贤楼10号', '113.681253,23.631036', '聚贤楼10号', '113.681253,23.631036', '聚贤楼10号', '113.681253,23.631036', '广州中大南方招待所', '113.676330,23.631332', '广州中大南方招待所', '113.676330,23.631332', '广州中大南方招待所', '113.676330,23.631332', '广州中大南方招待所', '113.676330,23.631332', '广州南方学院达人书院', '113.679041,23.632392', '广州南方学院达人书院', '113.679041,23.632392', '广州南方学院达人书院', '113.679041,23.632392', '广州南方学院达人书院', '113.679041,23.632392', '广州和风庭阿七度假别墅', '113.681736,23.630569', '广州和风庭阿七度假别墅', '113.681736,23.630569', '广州和风庭阿七度假别墅', '113.681736,23.630569', '广州和风庭阿七度假别墅', '113.681736,23.630569', '广州南方学院图书馆', '113.679177,23.632762', '广州南方学院图书馆', '113.679177,23.632762', '广州南方学院图书馆', '113.679177,23.632762', '广州南方学院图书馆', '113.679177,23.632762', '广州南方学院4号实验楼', '113.679963,23.632652', '广州南方学院4号实验楼', '113.679963,23.632652', '广州南方学院4号实验楼', '113.679963,23.632652', '广州南方学院4号实验楼', '113.679963,23.632652', '广州U优森特酒店', '113.679226,23.632528', '广州U优森特酒店', '113.679226,23.632528', '广州U优森特酒店', '113.679226,23.632528', '广州U优森特酒店', '113.679226,23.632528', 'L5员工宿舍', '113.682583,23.631487', 'L5员工宿舍', '113.682583,23.631487', 'L5员工宿舍', '113.682583,23.631487', 'L5员工宿舍', '113.682583,23.631487', '广州南方学院教学楼9号', '113.679747,23.633032', '广州南方学院教学楼9号', '113.679747,23.633032', '广州南方学院教学楼9号', '113.679747,23.633032', '广州南方学院教学楼9号', '113.679747,23.633032', '广州南方学院教学楼7号', '113.678600,23.633330', '广州南方学院教学楼7号', '113.678600,23.633330', '广州南方学院教学楼7号', '113.678600,23.633330', '广州南方学院教学楼7号', '113.678600,23.633330', '广州南方学院第11教学楼', '113.680037,23.633173', '广州南方学院第11教学楼', '113.680037,23.633173', '广州南方学院第11教学楼', '113.680037,23.633173', '广州南方学院第11教学楼', '113.680037,23.633173', '怒烤烤串(从化店)', '113.677160,23.632910', '怒烤烤串(从化店)', '113.677160,23.632910', '怒烤烤串(从化店)', '113.677160,23.632910', '怒烤烤串(从化店)', '113.677160,23.632910', '广州南方学院教学楼6号', '113.678424,23.633710', '广州南方学院教学楼6号', '113.678424,23.633710', '广州南方学院教学楼6号', '113.678424,23.633710', '广州南方学院教学楼6号', '113.678424,23.633710', '广州南方学院惟贤门', '113.678437,23.633721', '广州南方学院惟贤门', '113.678437,23.633721', '广州南方学院惟贤门', '113.678437,23.633721', '广州南方学院惟贤门', '113.678437,23.633721', '广州南方学院教学楼10号', '113.680125,23.633492', '广州南方学院教学楼10号', '113.680125,23.633492', '广州南方学院教学楼10号', '113.680125,23.633492', '广州南方学院教学楼10号', '113.680125,23.633492', '广州南方学院教学楼5号', '113.678046,23.633982', '广州南方学院教学楼5号', '113.678046,23.633982', '广州南方学院教学楼5号', '113.678046,23.633982', '广州南方学院教学楼5号', '113.678046,23.633982']\n"
     ]
    }
   ],
   "source": [
    "# 4. 请找出所有的 name 以及 location 做一个字典 （name_dict = {name1:location1 , name2:location2...}）\n",
    "\n",
    "name = []\n",
    "location = []\n",
    "for i in 广州南方学院['regeocode']['pois']:\n",
    "    for j in 广州南方学院['regeocode']['roads']:\n",
    "        name.append(i['name'])\n",
    "        name.append(i['location'])\n",
    "print(name)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bd63d739",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "1a38efe2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'id': 'B0FFG4TAF2', 'direction': '东南', 'businessarea': [], 'address': '温泉镇乌土村松浪队5号(近博学路)', 'poiweight': '0.237309', 'name': '广州南方公寓', 'location': '113.678983,23.627778', 'distance': '102.617', 'tel': '13622768437', 'type': '商务住宅;住宅区;住宅小区'}\n",
      "{'id': 'B0H6FA18J5', 'direction': '东南', 'businessarea': [], 'address': '从莞深高速(广州南方学院南侧)', 'poiweight': '0.223065', 'name': '保利半山花园', 'location': '113.679358,23.627672', 'distance': '139.054', 'tel': [], 'type': '商务住宅;住宅区;住宅区'}\n",
      "{'id': 'B00140TWHT', 'direction': '北', 'businessarea': [], 'address': '笃行路2', 'poiweight': '0.157653', 'name': '教工住宅1号', 'location': '113.678490,23.630432', 'distance': '222.658', 'tel': [], 'type': '商务住宅;住宅区;住宅小区'}\n",
      "{'id': 'B0FFHRJDM9', 'direction': '东南', 'businessarea': [], 'address': '中大南方学院南门1号', 'poiweight': '0.256152', 'name': '中南公寓', 'location': '113.680349,23.627573', 'distance': '231.723', 'tel': '13711245345', 'type': '商务住宅;住宅区;住宅小区'}\n",
      "{'id': 'B0HGD588HJ', 'direction': '北', 'businessarea': [], 'address': '博学路', 'poiweight': '0.221662', 'name': '广州南方学院教学楼4号', 'location': '113.677460,23.630490', 'distance': '242.901', 'tel': [], 'type': '科教文化服务;学校;学校'}\n",
      "{'id': 'B0FFHZH0IK', 'direction': '西北', 'businessarea': [], 'address': '博学路广州南方学院综合楼内', 'poiweight': '0.17934', 'name': '地下铁', 'location': '113.677941,23.629029', 'distance': '74.1376', 'tel': [], 'type': '餐饮服务;冷饮店;冷饮店'}\n",
      "{'id': 'B0HGDU76L2', 'direction': '北', 'businessarea': [], 'address': '博学路', 'poiweight': '0.221662', 'name': '广州南方学院2号实验楼', 'location': '113.678211,23.630956', 'distance': '280.003', 'tel': [], 'type': '科教文化服务;学校;学校'}\n",
      "{'id': 'B0FFKP838K', 'direction': '北', 'businessarea': [], 'address': '博学路25', 'poiweight': '0.191742', 'name': '教学楼3号(外国语学院)', 'location': '113.677247,23.630947', 'distance': '298.093', 'tel': [], 'type': '科教文化服务;学校;高等院校'}\n",
      "{'id': 'B0HGDU8NLD', 'direction': '北', 'businessarea': [], 'address': '博学路附近', 'poiweight': '0.221662', 'name': '广州南方学院1号实验楼', 'location': '113.678215,23.631370', 'distance': '326.007', 'tel': [], 'type': '科教文化服务;学校;学校'}\n",
      "{'id': 'B0HGD58UTU', 'direction': '西北', 'businessarea': [], 'address': '博学路', 'poiweight': '0.191229', 'name': '广州南方学院2号教学楼', 'location': '113.677060,23.631346', 'distance': '346.352', 'tel': [], 'type': '科教文化服务;学校;学校'}\n",
      "{'id': 'B00140MR9A', 'direction': '北', 'businessarea': [], 'address': '温泉大道882号', 'poiweight': '0.450402', 'name': '广州南方学院', 'location': '113.679262,23.632583', 'distance': '471.564', 'tel': '020-87828988;020-61787331', 'type': '科教文化服务;学校;高等院校'}\n",
      "{'id': 'B0HGDU92JD', 'direction': '北', 'businessarea': [], 'address': [], 'poiweight': '0.221662', 'name': '广州南方学院教学楼1号', 'location': '113.677077,23.631783', 'distance': '391.548', 'tel': [], 'type': '科教文化服务;学校;学校'}\n",
      "{'id': 'B0HGD592BJ', 'direction': '东北', 'businessarea': [], 'address': '温泉大道886号广州南方学院内', 'poiweight': '0.221662', 'name': '广州南方学院综合楼', 'location': '113.680117,23.631544', 'distance': '392.731', 'tel': [], 'type': '科教文化服务;学校;学校'}\n",
      "{'id': 'B0FFKP81F0', 'direction': '西北', 'businessarea': [], 'address': '博学路19号附近', 'poiweight': '0.191742', 'name': '教学楼1号(文学与传媒学院)', 'location': '113.676866,23.631736', 'distance': '393.93', 'tel': [], 'type': '科教文化服务;科教文化场所;科教文化场所'}\n",
      "{'id': 'B0FFLBEOND', 'direction': '东北', 'businessarea': [], 'address': '从莞深高速(广州南方学院)', 'poiweight': '0.190963', 'name': '聚贤楼10号', 'location': '113.681253,23.631036', 'distance': '418.51', 'tel': [], 'type': '商务住宅;住宅区;宿舍'}\n",
      "{'id': 'B0FFH6K3U9', 'direction': '西北', 'businessarea': [], 'address': '温泉镇温泉大道882号广州南方学院H7栋1-5层', 'poiweight': '0.254885', 'name': '广州中大南方招待所', 'location': '113.676330,23.631332', 'distance': '378.102', 'tel': '020-61787222', 'type': '住宿服务;住宿服务相关;住宿服务相关'}\n",
      "{'id': 'B0HGD58NF8', 'direction': '北', 'businessarea': [], 'address': '温泉大道882号广州南方学院新综合楼2层', 'poiweight': '0.191229', 'name': '广州南方学院达人书院', 'location': '113.679041,23.632392', 'distance': '446.366', 'tel': [], 'type': '科教文化服务;科教文化场所;科教文化场所'}\n",
      "{'id': 'B0FFKUVYWV', 'direction': '东北', 'businessarea': [], 'address': '保利桃花源', 'poiweight': '0.273168', 'name': '广州和风庭阿七度假别墅', 'location': '113.681736,23.630569', 'distance': '424.35', 'tel': '18681565305', 'type': '住宿服务;住宿服务相关;住宿服务相关'}\n",
      "{'id': 'B0HGDU99RM', 'direction': '北', 'businessarea': [], 'address': '温泉大道882号广州南方学院内', 'poiweight': '0.257947', 'name': '广州南方学院图书馆', 'location': '113.679177,23.632762', 'distance': '489.331', 'tel': '020-61787368;020-61787371', 'type': '科教文化服务;图书馆;图书馆'}\n",
      "{'id': 'B0HGDU92JC', 'direction': '北', 'businessarea': [], 'address': '博学路附近', 'poiweight': '0.221662', 'name': '广州南方学院4号实验楼', 'location': '113.679963,23.632652', 'distance': '498.883', 'tel': [], 'type': '科教文化服务;学校;学校'}\n",
      "{'id': 'B0FFL7C054', 'direction': '北', 'businessarea': [], 'address': '温泉镇博学路882号(广州南方学院商业中心1层)', 'poiweight': '0.317505', 'name': '广州U优森特酒店', 'location': '113.679226,23.632528', 'distance': '464.819', 'tel': '15813395296', 'type': '住宿服务;住宿服务相关;住宿服务相关'}\n",
      "{'id': 'B0FFG8CSEK', 'direction': '东北', 'businessarea': [], 'address': '从莞深高速(广州南方学院)', 'poiweight': '0.185371', 'name': 'L5员工宿舍', 'location': '113.682583,23.631487', 'distance': '554.129', 'tel': [], 'type': '商务住宅;住宅区;宿舍'}\n",
      "{'id': 'B0HGD58FR2', 'direction': '北', 'businessarea': [], 'address': '广州南方学院', 'poiweight': '0.221662', 'name': '广州南方学院教学楼9号', 'location': '113.679747,23.633032', 'distance': '532.163', 'tel': [], 'type': '科教文化服务;学校;学校'}\n",
      "{'id': 'B0HG5Z9JNK', 'direction': '北', 'businessarea': [], 'address': '博学路', 'poiweight': '0.221553', 'name': '广州南方学院教学楼7号', 'location': '113.678600,23.633330', 'distance': '544.868', 'tel': [], 'type': '科教文化服务;学校;学校'}\n",
      "{'id': 'B0HGD599JM', 'direction': '北', 'businessarea': [], 'address': '温泉大道882号广州南方学院', 'poiweight': '0.221662', 'name': '广州南方学院第11教学楼', 'location': '113.680037,23.633173', 'distance': '556.036', 'tel': [], 'type': '科教文化服务;学校;学校'}\n",
      "{'id': 'B0GUJYPEG2', 'direction': '北', 'businessarea': [], 'address': '温泉大道882号广州南方学院内博学路6号之3', 'poiweight': '0.216026', 'name': '怒烤烤串(从化店)', 'location': '113.677160,23.632910', 'distance': '510.112', 'tel': [], 'type': '餐饮服务;中餐厅;特色/地方风味餐厅'}\n",
      "{'id': 'B0HGDU6Z41', 'direction': '北', 'businessarea': [], 'address': '温泉大道882', 'poiweight': '0.221662', 'name': '广州南方学院教学楼6号', 'location': '113.678424,23.633710', 'distance': '586.331', 'tel': [], 'type': '科教文化服务;学校;学校'}\n",
      "{'id': 'B0HGD580NZ', 'direction': '北', 'businessarea': [], 'address': '博学路7号附近', 'poiweight': '0.285712', 'name': '广州南方学院惟贤门', 'location': '113.678437,23.633721', 'distance': '587.601', 'tel': [], 'type': '科教文化服务;学校;高等院校'}\n",
      "{'id': 'B0HGDU7T1K', 'direction': '北', 'businessarea': [], 'address': '从莞深高速(广州南方学院)', 'poiweight': '0.191229', 'name': '广州南方学院教学楼10号', 'location': '113.680125,23.633492', 'distance': '592.504', 'tel': [], 'type': '科教文化服务;科教文化场所;科教文化场所'}\n",
      "{'id': 'B0HGDU76L1', 'direction': '北', 'businessarea': [], 'address': '中山路与博学路交叉口东南150米', 'poiweight': '0.221662', 'name': '广州南方学院教学楼5号', 'location': '113.678046,23.633982', 'distance': '616.848', 'tel': [], 'type': '科教文化服务;学校;学校'}\n"
     ]
    }
   ],
   "source": [
    "# 5. 请找出所有 含有 'tel' 的元素\n",
    "for i in 广州南方学院['regeocode']['pois']:\n",
    "    if 'tel' in i:\n",
    "        print(i)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
